﻿Imports System.ComponentModel


Partial Class MainWindow
    Implements INotifyPropertyChanging
    Implements INotifyPropertyChanged

    Public Event PropertyChanging(sender As Object, e As PropertyChangingEventArgs) Implements INotifyPropertyChanging.PropertyChanging
    Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged


    Private Sub NotifyPropertyChanging(propertyName As String)
        RaiseEvent PropertyChanging(Me, New PropertyChangingEventArgs(propertyName))
    End Sub

    Private Sub NotifyPropertyChanged(propertyName As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
    End Sub


    Private _ConnectionState As String = "Disconnected"
    Public Property ConnectionState As String
        Get
            Return _ConnectionState
        End Get
        Set(value As String)
            If value <> _ConnectionState Then
                NotifyPropertyChanging("ConnectionState")
                _ConnectionState = value
                NotifyPropertyChanged("ConnectionState")
            End If
        End Set
    End Property

    Private _isConnected As Boolean = False
    Public Property IsConnected As Boolean
        Get
            Return _isConnected
        End Get
        Set(value As Boolean)
            If value <> _isConnected Then
                NotifyPropertyChanging("IsConnected")
                _isConnected = value
                NotifyPropertyChanged("IsConnected")
            End If
        End Set
    End Property
End Class